<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="合同名称" prop="contractName">
        <el-input
          v-model="queryParams.contractName"
          placeholder="请输入合同名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="合同类型" prop="contractType">
        <el-select v-model="queryParams.contractType" placeholder="请选择合同类型" clearable>
          <el-option
            v-for="dict in dict.type.htlx"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="合同状态" prop="contractStatus">
        <el-select v-model="queryParams.contractStatus" placeholder="请选择合同状态" clearable>
          <el-option
            v-for="dict in dict.type.htzt"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['system:info:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['system:info:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['system:info:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['system:info:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="infoList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="合同编号" align="center" prop="contractId" width="160">
        <template slot-scope="scope">
          <el-tooltip content="格式：HT+年月日+序号" placement="top">
            <span>{{ scope.row.contractId }}</span>
          </el-tooltip>
        </template>
      </el-table-column>
      <el-table-column label="合同名称" align="center" prop="contractName" />
      <el-table-column label="合同类型" align="center" prop="contractType">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.htlx" :value="scope.row.contractType"/>
        </template>
      </el-table-column>
      <el-table-column label="合同金额" align="center" prop="contractAmount" />
      <el-table-column label="合同状态" align="center" prop="contractStatus">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.htzt" :value="scope.row.contractStatus"/>
        </template>
      </el-table-column>
      <el-table-column label="备注" align="center" prop="remarks" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['system:info:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['system:info:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改合同信息对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <!-- 合同编号 - 只在编辑模式显示，且为只读 -->
        <el-row v-if="form.contractId" :gutter="20">
          <el-col :span="12">
            <el-form-item label="合同编号" prop="contractId">
              <el-input v-model="form.contractId" disabled>
                <template slot="append">
                  <el-tooltip content="格式：HT+年月日+序号，如HT2025051901" placement="top">
                    <i class="el-icon-info"></i>
                  </el-tooltip>
                </template>
              </el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row v-else :gutter="20">
          <el-col :span="24">
            <div class="el-form-item__hint" style="padding-left: 80px; margin-bottom: 15px; color: #909399;">
              <i class="el-icon-info"></i> 合同编号将自动生成，格式：HT+年月日+序号，例如 HT2025051901
            </div>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="合同名称" prop="contractName">
              <el-input v-model="form.contractName" placeholder="请输入合同名称" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="合同类型" prop="contractType">
              <el-select v-model="form.contractType" placeholder="请选择合同类型">
                <el-option
                  v-for="dict in dict.type.htlx"
                  :key="dict.value"
                  :label="dict.label"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="签订日期" prop="signingDate">
              <el-date-picker clearable
                v-model="form.signingDate"
                type="date"
                value-format="yyyy-MM-dd"
                placeholder="请选择签订日期">
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="生效日期" prop="effectiveDate">
              <el-date-picker clearable
                v-model="form.effectiveDate"
                type="date"
                value-format="yyyy-MM-dd"
                placeholder="请选择生效日期">
              </el-date-picker>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="到期日期" prop="expirationDate">
              <el-date-picker clearable
                v-model="form.expirationDate"
                type="date"
                value-format="yyyy-MM-dd"
                placeholder="请选择到期日期">
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="合同金额" prop="contractAmount">
              <el-input v-model="form.contractAmount" placeholder="请输入合同金额" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="合同状态" prop="contractStatus">
              <el-select v-model="form.contractStatus" placeholder="请选择合同状态">
                <el-option
                  v-for="dict in dict.type.htzt"
                  :key="dict.value"
                  :label="dict.label"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="付款条款" prop="paymentTerms">
              <el-input v-model="form.paymentTerms" type="textarea" placeholder="请输入内容" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="备注" prop="remarks">
              <el-input v-model="form.remarks" type="textarea" placeholder="请输入内容" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="文件" prop="fileInfo">
              <file-upload v-model="form.fileInfo" ref="fileUpload" :show-file-list="false" :on-progress="handleUploadProgress" @input="updateParsedFileList">
                <el-button size="small" type="primary">选取文件</el-button>
                <div slot="tip" class="el-upload__tip">文件大小不超过500MB</div>
              </file-upload>
              <!-- 已上传文件列表 -->
              <div class="existing-files" v-if="(uploadingFiles && uploadingFiles.length > 0) || (parsedFileList && parsedFileList.length > 0)">
                <!-- 已上传的文件，带下载/删除或进度条 -->
                <div class="file-item" v-for="(file, index) in parsedFileList" :key="file.fullInfo">
                  <span class="file-name">{{ file.name }}</span>
                  <!-- 如果该文件正在上传，显示进度条 -->
                  <template v-if="uploadingFiles.some(f => f.name === file.name)">
                    <el-progress
                      :percentage="uploadingFiles.find(f => f.name === file.name).percentage"
                      status="active"
                      :stroke-width="4"
                      style="width: 60%; margin-left: 16px; display: inline-block;"
                    />
                    <span style="margin-left: 8px; color: #409EFF; font-weight: bold;">
                      {{ uploadingFiles.find(f => f.name === file.name).percentage }}%
                    </span>
                  </template>
                  <template v-else>
                    <div class="file-actions">
                      <el-button
                        type="text"
                        size="mini"
                        icon="el-icon-download"
                        @click="handleDownload(file)"
                      >下载</el-button>
                      <el-button
                        type="text"
                        size="mini"
                        icon="el-icon-delete"
                        @click="handleFileDelete(index)"
                      >删除</el-button>
                    </div>
                  </template>
                </div>
                <!-- 正在上传但还未进入parsedFileList的文件 -->
                <div class="file-item" v-for="file in uploadingFiles.filter(f => !parsedFileList.some(pf => pf.name === f.name))" :key="file.uid">
                  <span class="file-name">{{ file.name }}</span>
                  <el-progress :percentage="file.percentage" status="active" :stroke-width="4" style="width: 60%; margin-left: 16px; display: inline-block;" />
                  <span style="margin-left: 8px; color: #409EFF; font-weight: bold;">{{ file.percentage }}%</span>
                </div>
              </div>
              <!-- 自定义进度条显示 -->
              <div v-for="file in uploadingFiles" :key="file.uid" class="custom-upload-progress">
                <span class="progress-file-name">{{ file.name }}</span>
                <el-progress :percentage="file.percentage" status="active" :stroke-width="4" style="width: 80%; display: inline-block; margin-left: 16px;"/>
                <span style="margin-left: 8px; color: #409EFF; font-weight: bold;">{{ file.percentage }}%</span>
              </div>
            </el-form-item>
          </el-col>
        </el-row>
        
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { listInfo, getInfo, delInfo, addInfo, updateInfo } from "@/api/system/info";
import { getToken } from "@/utils/auth";

export default {
  name: "Info",
  dicts: ['htlx', 'htzt'],
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 合同信息表格数据
      infoList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        contractName: null,
        contractType: null,
        contractStatus: null,
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        contractName: [
          { required: true, message: "合同名称不能为空", trigger: "blur" }
        ],
      },
      // 解析后的文件列表
      parsedFileList: [],
      upload: {
        url: '',
        headers: {}
      },
      fileList: [],
      // 在data中添加uploadingFiles
      uploadingFiles: []
    };
  },
  created() {
    this.getList();
  },
  watch: {
    open(val) {
      if (val) {
        // 弹窗打开时，确保文件列表回显
        this.updateParsedFileList();
      } else {
        // 弹窗关闭时，清空上传进度
        this.uploadingFiles = [];
      }
    }
  },
  methods: {
    /** 查询合同信息列表 */
    getList() {
      this.loading = true;
      listInfo(this.queryParams).then(response => {
        this.infoList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        contractId: null,
        contractName: null,
        contractType: null,
        customerId: null,
        signingDate: null,
        effectiveDate: null,
        expirationDate: null,
        contractAmount: null,
        paymentTerms: null,
        contractStatus: null,
        fileInfo: "",
        createTime: null,
        updateTime: null,
        remarks: null
      };
      this.resetForm("form");
      // 清除文件相关的所有数据
      this.parsedFileList = [];
      this.fileList = [];
      // 确保file-upload组件的文件列表也被清空
      if (this.$refs.fileUpload) {
        this.$refs.fileUpload.clearFiles();
      }
      // 强制更新视图
      this.$forceUpdate();
      // 手动触发表单验证
      this.$nextTick(() => {
        if (this.$refs.form) {
          this.$refs.form.clearValidate();
        }
      });
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.contractId)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      // 确保新增时没有contractId，让后端生成HT+年月日+序号格式的合同编号
      this.form.contractId = undefined;
      this.open = true;
      this.title = "添加合同信息";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const contractId = row.contractId || this.ids
      getInfo(contractId).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改合同信息";
        this.updateParsedFileList();
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.contractId != null) {
            updateInfo(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            // 合同编号将由后端生成，格式为：HT+年月日+序号，例如HT2025051901
            // 确保提交前移除contractId字段，避免使用数据库自增ID
            const submitForm = {...this.form};
            delete submitForm.contractId;
            
            addInfo(submitForm).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const contractIds = row.contractId || this.ids;
      this.$modal.confirm('是否确认删除合同信息编号为"' + contractIds + '"的数据项？').then(function() {
        return delInfo(contractIds);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('system/info/export', {
        ...this.queryParams
      }, `info_${new Date().getTime()}.xlsx`)
    },
    /** 获取原始文件名 */
    getOriginalFileName(fileInfo) {
      if (!fileInfo) return '';
      const parts = fileInfo.split('|');
      return parts[0] || '';
    },
    /** 获取存储路径 */
    getStoragePath(fileInfo) {
      if (!fileInfo) return '';
      const parts = fileInfo.split('|');
      return parts[1] || '';
    },
    /** 文件删除处理 */
    handleFileDelete(index) {
      this.$modal.confirm('是否确认删除该文件？').then(() => {
        if (this.parsedFileList && this.parsedFileList.length > index) {
          // 从文件列表中移除文件
          const files = this.form.fileInfo ? this.form.fileInfo.split(';').filter(Boolean) : [];
          files.splice(index, 1);
          
          // 更新form中的fileInfo
          this.form.fileInfo = files.length > 0 ? files.join(';') : "";
          
          // 更新显示的文件列表
          this.parsedFileList.splice(index, 1);
          
          // 如果没有文件了，清空所有相关数据
          if (!files.length) {
            this.form.fileInfo = "";
            this.parsedFileList = [];
            this.fileList = [];
            if (this.$refs.fileUpload) {
              this.$refs.fileUpload.clearFiles();
              // 手动触发input事件
              this.$refs.fileUpload.$emit("input", "");
            }
          }
          
          // 强制更新视图
          this.$forceUpdate();
          
          // 手动触发表单验证
          this.$nextTick(() => {
            if (this.$refs.form) {
              this.$refs.form.validateField('fileInfo');
            }
          });
          
          this.$modal.msgSuccess("删除成功");
        }
      }).catch(() => {});
    },
    
    /** 格式化文件名 */
    formatFileName(fullName) {
      if (!fullName) return '';
      // 移除时间戳和哈希值部分，只保留原始文件名
      const match = fullName.match(/^\d{14}_[a-f0-9]+_(.+)$/) || fullName.match(/^\d{14}_[a-f0-9]+\.(.+)$/);
      if (match && match[1]) {
        return match[1];
      }
      // 如果没有匹配到特定格式，返回原始文件名
      return fullName;
    },

    /** 更新已解析的文件列表 */
    updateParsedFileList() {
      if (!this.form.fileInfo) {
        this.parsedFileList = [];
        return;
      }
      // 过滤空值并去重
      const uniqueFiles = new Set(this.form.fileInfo.split(';').filter(file => file && file.trim()));
      this.parsedFileList = Array.from(uniqueFiles).map(fileInfo => {
        const parts = fileInfo.split('|');
        const originalName = parts[0] || fileInfo;
        return {
          name: this.formatFileName(originalName),
          path: fileInfo,
          fullInfo: fileInfo
        };
      });
      // 更新form中的fileInfo，确保没有重复项
      this.form.fileInfo = Array.from(uniqueFiles).join(';');
    },
    
    /** 清除文件信息 */
    clearFileInfo() {
      this.form.fileInfo = "";
      this.parsedFileList = [];
      this.fileList = [];
      if (this.$refs.fileUpload) {
        this.$refs.fileUpload.clearFiles();
        // 手动触发input事件
        this.$refs.fileUpload.$emit("input", "");
      }
      // 强制更新视图
      this.$forceUpdate();
      // 手动触发表单验证
      this.$nextTick(() => {
        if (this.$refs.form) {
          this.$refs.form.validateField('fileInfo');
        }
      });
    },
    
    /** 下载单个文件 */
    handleDownload(file) {
      console.log("开始下载文件:", file);
      
      const totalAttempts = 3; // 最大尝试次数
      this.tryDownloadFile(file, 0, totalAttempts);
    },
    
    /** 尝试下载文件，支持多次尝试 */
    tryDownloadFile(file, attempt, totalAttempts) {
      if (attempt >= totalAttempts) {
        this.$modal.msgError(`下载尝试 ${totalAttempts} 次后失败，请联系管理员。`);
        return;
      }
      
      console.log(`尝试下载 (${attempt + 1}/${totalAttempts}):`, file);
      
      // 根据尝试次数使用不同的下载策略
      let filePath = file.fullInfo;
      if (attempt === 1 && file.path) {
        // 第二次尝试：只使用路径部分
        filePath = file.path;
        console.log("使用路径部分尝试下载:", filePath);
      } else if (attempt === 2 && file.name) {
        // 第三次尝试：使用文件名尝试
        filePath = file.name;
        console.log("使用文件名尝试下载:", filePath);
      }
      
      // 使用专用的合同文件下载API
      const baseUrl = process.env.VUE_APP_BASE_API;
      const token = getToken();
      const url = baseUrl + "/system/info/downloadFile";
      
      // 准备要发送的数据
      const formData = new FormData();
      formData.append("filePath", filePath);
      
      const xhr = new XMLHttpRequest();
      xhr.open("POST", url, true);
      xhr.responseType = "blob";
      xhr.setRequestHeader("Authorization", "Bearer " + token);
      
      xhr.onload = () => {
        if (xhr.status === 200 && xhr.response && xhr.response.size > 0) {
          console.log("下载成功，文件大小:", xhr.response.size);
          
          // 下载成功
          const blob = new Blob([xhr.response]);
          const downloadFileName = file.name || "未命名文件";
          
          if (window.navigator.msSaveOrOpenBlob) {
            navigator.msSaveBlob(blob, downloadFileName);
          } else {
            const url = window.URL.createObjectURL(blob);
            const link = document.createElement("a");
            link.href = url;
            link.setAttribute("download", downloadFileName);
            document.body.appendChild(link);
            link.click();
            document.body.removeChild(link);
            window.URL.revokeObjectURL(url);
          }
          
          // 显示成功消息
          this.$modal.msgSuccess(`文件"${downloadFileName}"下载成功`);
        } else {
          console.error("下载失败，状态:", xhr.status, "大小:", xhr.response ? xhr.response.size : 0);
          
          // 尝试下一个策略
          setTimeout(() => {
            this.tryDownloadFile(file, attempt + 1, totalAttempts);
          }, 1000);
        }
      };
      
      xhr.onerror = () => {
        console.error("下载请求失败");
        
        // 尝试下一个策略
        setTimeout(() => {
          this.tryDownloadFile(file, attempt + 1, totalAttempts);
        }, 1000);
      };
      
      xhr.send(formData);
    },
    /** 文件上传成功处理 */
    handleUploadSuccess(response, file) {
      if (response.code === 200) {
        // 追加新文件到 fileInfo
        if (this.form.fileInfo) {
          this.form.fileInfo = this.form.fileInfo + ';' + response.data;
        } else {
          this.form.fileInfo = response.data;
        }
        // 立即刷新已上传文件列表
        this.updateParsedFileList();
        this.$modal.msgSuccess("上传成功");
      } else {
        this.$modal.msgError(response.msg || "上传失败");
      }
    },
    handleUploadError(error) {
      // 处理上传错误后的逻辑
      console.error("上传错误:", error);
    },
    handleFileRemove(file) {
      // 处理文件移除后的逻辑
      console.log("移除的文件:", file);
    },
    handleBeforeUpload(file) {
      // 处理上传前的逻辑
      console.log("上传前的文件:", file);
    },
    // 在methods中添加handleUploadProgress
    handleUploadProgress(event, file, fileList) {
      // 查找或添加文件
      let f = this.uploadingFiles.find(f => f.uid === file.uid);
      if (!f) {
        f = { uid: file.uid, name: file.name, percentage: 0 };
        this.uploadingFiles.push(f);
      }
      f.percentage = Math.floor(event.percent);
      // 上传完成后延迟移除
      if (f.percentage === 100) {
        setTimeout(() => {
          this.uploadingFiles = this.uploadingFiles.filter(item => item.uid !== file.uid);
        }, 1000);
      }
    }
  }
};
</script>

<style scoped>
.upload-demo {
  margin-bottom: 10px;
}

.el-upload__tip {
  line-height: 1.2;
  color: #909399;
  font-size: 12px;
}

.existing-files {
  margin-top: 10px;
  border: 1px solid #EBEEF5;
  border-radius: 4px;
  padding: 5px 10px;
  max-height: 200px;
  overflow-y: auto;
}

.file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid #EBEEF5;
}

.file-item:last-child {
  border-bottom: none;
}

.file-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-actions {
  margin-left: 10px;
  white-space: nowrap;
}

.el-dialog .el-form-item__label {
  font-weight: bold;
}

/* 统一表单输入组件宽度 */
.el-form-item .el-input,
.el-form-item .el-select,
.el-form-item .el-date-picker {
  width: 100%;
}

/* 只隐藏上传成功后的文件名，不隐藏进度条 */
.upload-demo .el-upload-list__item.is-success {
  display: none !important;
}

/* 在style中添加自定义进度条样式 */
.custom-upload-progress {
  display: flex;
  align-items: center;
  margin-top: 8px;
  margin-bottom: 4px;
}
.progress-file-name {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #606266;
}
</style>
